package com.cyzy.service;

import com.cyzy.entity.Curriculum;
import com.cyzy.mapper.ScheduleMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ScheduleService {

    @Autowired
    private ScheduleMapper scheduleMapper;

    // 获取指定班级的课程
    public List<Curriculum> getScheduleByClassId(Integer classId) {
        return scheduleMapper.getScheduleByClassId(classId);
    }

    // 获取指定班级和星期的课程
    public List<Curriculum> getScheduleByClassIdAndWeekday(Integer classId, Integer weekday) {
        return scheduleMapper.getScheduleByClassIdAndWeekday(classId, weekday);
    }
    //传入星期几数字和上下午1/2判断是否有课
    public List<Curriculum> getScheduleByClassIdAndWeekdayAndTimePeriod(Integer classId, Integer weekday, Integer timePeriod) {
        return scheduleMapper.getScheduleByClassIdAndWeekdayAndTimePeriod(classId, weekday, timePeriod);
    }
}
